<template>
  <div class="app">
    <router-view></router-view>
    <Footer />
  </div>
</template>

<script setup>
import Footer from "@/components/Footer.vue";
rem();
//手写 rem 布局
window.onresize = function () {
  rem();
};

//rem函数
function rem() {
  // html的宽度
  let myHtml = document.documentElement.clientWidth;
  // body的宽度
  let myBody = document.body.clientWidth;
  // console.log(myHtml, myBody);
  let h = myHtml || myBody;

  document.documentElement.style.fontSize = (h / 750) * 100 + "px";
}
</script>

<style  scoped>
.app{
  background-color: #fff;
  height: 100%;
}
</style>